<!DOCTYPE html>
<html lang="zh-Hans" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>首页配置 | VitePress基础框架</title>
    <meta name="description" content="VitePress基础框架的站点描述">
    <meta name="generator" content="VitePress v1.3.4">
    <link rel="preload stylesheet" href="/vitepress-template-public/assets/style.BlgVYu-Y.css" as="style">
    <script type="module" src="/vitepress-template-public/assets/chunks/metadata.e7f3cd1f.js"></script>
    <script type="module" src="/vitepress-template-public/assets/app.B7Bvz4Bc.js"></script>
    <link rel="preload" href="/vitepress-template-public/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/theme.B1DMWA2k.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/chunks/framework.D5O-cTmz.js">
    <link rel="modulepreload" href="/vitepress-template-public/assets/guide_config-home.md.CxMw-jRu.lean.js">
    <link rel="icon" type="image/svg+xml" href="./logo/vitepress-logo-mini.svg">
    <link rel="icon" type="image/png" href="./logo/vitepress-logo-mini.png">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-b928bd87><!--[--><!--]--><!--[--><span tabindex="-1" data-v-7de6d21b></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-7de6d21b> Skip to content </a><!--]--><!----><header class="VPNav" data-v-b928bd87 data-v-7614e298><div class="VPNavBar" data-v-7614e298 data-v-4a78392f><div class="wrapper" data-v-4a78392f><div class="container" data-v-4a78392f><div class="title" data-v-4a78392f><div class="VPNavBarTitle has-sidebar" data-v-4a78392f data-v-a1bbf3b8><a class="title" href="/vitepress-template-public/" data-v-a1bbf3b8><!--[--><!--]--><!--[--><img class="VPImage logo" src="/vitepress-template-public/logo/vitepress-logo-mini.svg" width="24" height="24" alt data-v-5f4c361e><!--]--><span data-v-a1bbf3b8>VitePress基础框架</span><!--[--><!--]--></a></div></div><div class="content" data-v-4a78392f><div class="content-body" data-v-4a78392f><!--[--><!--]--><div class="VPNavBarSearch search" data-v-4a78392f><!----></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-4a78392f data-v-1eb62029><span id="main-nav-aria-label" class="visually-hidden" data-v-1eb62029> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/vitepress-template-public/guide/install" tabindex="0" data-v-1eb62029 data-v-c4db28c0><!--[--><span data-v-c4db28c0>教程</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/vitepress-template-public/examples/markdown" tabindex="0" data-v-1eb62029 data-v-c4db28c0><!--[--><span data-v-c4db28c0>示例</span><!--]--></a><!--]--><!--[--><div class="VPFlyout VPNavBarMenuGroup" data-v-1eb62029 data-v-8c3a7de4><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-8c3a7de4><span class="text" data-v-8c3a7de4><!----><span data-v-8c3a7de4>下拉导航</span><span class="vpi-chevron-down text-icon" data-v-8c3a7de4></span></span></button><div class="menu" data-v-8c3a7de4><div class="VPMenu" data-v-8c3a7de4 data-v-387194d2><div class="items" data-v-387194d2><!--[--><!--[--><div class="VPMenuGroup" data-v-387194d2 data-v-91ebaee2><p class="title" data-v-91ebaee2>下拉导航标题</p><!--[--><!--[--><div class="VPMenuLink" data-v-91ebaee2 data-v-f484e6ee><a class="VPLink link vp-external-link-icon" href="https://github.com/dcdy/vitepress-template/edit/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-f484e6ee><!--[-->子项A<!--]--></a></div><!--]--><!--[--><div class="VPMenuLink" data-v-91ebaee2 data-v-f484e6ee><a class="VPLink link vp-external-link-icon" href="https://gitee.com/xia_mei_ting/vitepress-template/blob/main/docs/.vitepress/config.mts" target="_blank" rel="noreferrer" data-v-f484e6ee><!--[-->子项B<!--]--></a></div><!--]--><!--]--></div><!--]--><!--]--></div><!--[--><!--]--></div></div></div><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-4a78392f data-v-429aef54><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-429aef54 data-v-51f78c2c data-v-7bf662e2><span class="check" data-v-7bf662e2><span class="icon" data-v-7bf662e2><!--[--><span class="vpi-sun sun" data-v-51f78c2c></span><span class="vpi-moon moon" data-v-51f78c2c></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-4a78392f data-v-efa425a3 data-v-c2882db4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-4a78392f data-v-12aa81bd data-v-8c3a7de4><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-8c3a7de4><span class="vpi-more-horizontal icon" data-v-8c3a7de4></span></button><div class="menu" data-v-8c3a7de4><div class="VPMenu" data-v-8c3a7de4 data-v-387194d2><!----><!--[--><!--[--><!----><div class="group" data-v-12aa81bd><div class="item appearance" data-v-12aa81bd><p class="label" data-v-12aa81bd>主题</p><div class="appearance-action" data-v-12aa81bd><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-12aa81bd data-v-51f78c2c data-v-7bf662e2><span class="check" data-v-7bf662e2><span class="icon" data-v-7bf662e2><!--[--><span class="vpi-sun sun" data-v-51f78c2c></span><span class="vpi-moon moon" data-v-51f78c2c></span><!--]--></span></span></button></div></div></div><div class="group" data-v-12aa81bd><div class="item social-links" data-v-12aa81bd><div class="VPSocialLinks social-links-list" data-v-12aa81bd data-v-c2882db4><!--[--><a class="VPSocialLink no-icon" href="https://github.com/dcdy/vitepress-template" aria-label="github" target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><span class="vpi-social-github" /></a><a class="VPSocialLink no-icon" href="https://gitee.com/xia_mei_ting/vitepress-template" aria-label target="_blank" rel="noopener" data-v-c2882db4 data-v-788a0e61><svg t="1727428813465" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2268" width="200" height="200"><path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2269"></path></svg></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-4a78392f data-v-8aa5fe9b><span class="container" data-v-8aa5fe9b><span class="top" data-v-8aa5fe9b></span><span class="middle" data-v-8aa5fe9b></span><span class="bottom" data-v-8aa5fe9b></span></span></button></div></div></div></div><div class="divider" data-v-4a78392f><div class="divider-line" data-v-4a78392f></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-b928bd87 data-v-84e6a0db><div class="container" data-v-84e6a0db><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-84e6a0db><span class="vpi-align-left menu-icon" data-v-84e6a0db></span><span class="menu-text" data-v-84e6a0db>菜单</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-84e6a0db data-v-39065feb><button data-v-39065feb>回到顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-b928bd87 data-v-754706ac><div class="curtain" data-v-754706ac></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-754706ac><span class="visually-hidden" id="sidebar-aria-label" data-v-754706ac> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-a51db1f1><section class="VPSidebarItem level-0 collapsible has-active" data-v-a51db1f1 data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h2 class="text" data-v-39a5995e>简介</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-39a5995e><span class="vpi-chevron-right caret-icon" data-v-39a5995e></span></div></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-1 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/install" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>安装</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 has-active" data-v-39a5995e data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h3 class="text" data-v-39a5995e>配置</h3><!----></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-2 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-home" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>首页配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/config-doc" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>文档配置</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-a51db1f1><section class="VPSidebarItem level-0 collapsible" data-v-a51db1f1 data-v-39a5995e><div class="item" role="button" tabindex="0" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><h2 class="text" data-v-39a5995e>部署</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-39a5995e><span class="vpi-chevron-right caret-icon" data-v-39a5995e></span></div></div><div class="items" data-v-39a5995e><!--[--><div class="VPSidebarItem level-1 is-link" data-v-39a5995e data-v-39a5995e><div class="item" data-v-39a5995e><div class="indicator" data-v-39a5995e></div><a class="VPLink link link" href="/vitepress-template-public/guide/github-pages" data-v-39a5995e><!--[--><p class="text" data-v-39a5995e>Github Pages</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-b928bd87 data-v-5d97ccec><div class="VPDoc has-sidebar has-aside" data-v-5d97ccec data-v-184b3be7><!--[--><!--]--><div class="container" data-v-184b3be7><div class="aside" data-v-184b3be7><div class="aside-curtain" data-v-184b3be7></div><div class="aside-container" data-v-184b3be7><div class="aside-content" data-v-184b3be7><div class="VPDocAside" data-v-184b3be7 data-v-f6e4fd1a><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-f6e4fd1a data-v-c582f5e1><div class="content" data-v-c582f5e1><div class="outline-marker" data-v-c582f5e1></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-c582f5e1>页面导航</div><ul class="VPDocOutlineItem root" data-v-c582f5e1 data-v-9dd79648><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-f6e4fd1a></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-184b3be7><div class="content-container" data-v-184b3be7><!--[--><!--]--><main class="main" data-v-184b3be7><div style="position:relative;" class="vp-doc _vitepress-template-public_guide_config-home external-link-icon-enabled" data-v-184b3be7><div><h1 id="首页配置" tabindex="-1">首页配置 <a class="header-anchor" href="#首页配置" aria-label="Permalink to &quot;首页配置&quot;">​</a></h1><h2 id="配置图" tabindex="-1">配置图 <a class="header-anchor" href="#配置图" aria-label="Permalink to &quot;配置图&quot;">​</a></h2><p><span class="img-wrapper"><img src="https://cdn.jsdelivr.net/gh/dcdy/image/img/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20241017163919.png" alt="首页配置图片" class="img-loading" onload="this.classList.remove(&#39;img-loading&#39;)" onerror="this.classList.remove(&#39;img-loading&#39;); this.classList.add(&#39;img-error&#39;)"></span></p><h2 id="网站图标和标题" tabindex="-1">网站图标和标题 <a class="header-anchor" href="#网站图标和标题" aria-label="Permalink to &quot;网站图标和标题&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#E06C75;">	title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;VitePress基础框架&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 标题</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// Head配置</span></span>
<span class="line"><span style="color:#E06C75;">	head</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">		[</span><span style="color:#98C379;">&#39;link&#39;</span><span style="color:#ABB2BF;">, { </span><span style="color:#E06C75;">rel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;icon&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;image/svg+xml&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">href</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;./logo/vitepress-logo-mini.svg&#39;</span><span style="color:#ABB2BF;"> }], </span><span style="color:#7F848E;font-style:italic;">// 网站图标</span></span>
<span class="line"><span style="color:#ABB2BF;">		[</span><span style="color:#98C379;">&#39;link&#39;</span><span style="color:#ABB2BF;">, { </span><span style="color:#E06C75;">rel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;icon&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">type</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;image/png&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">href</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;./logo/vitepress-logo-mini.png&#39;</span><span style="color:#ABB2BF;"> }], </span><span style="color:#7F848E;font-style:italic;">// 网站图标</span></span>
<span class="line"><span style="color:#ABB2BF;">	],</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="导航-logo-和标题" tabindex="-1">导航 LOGO 和标题 <a class="header-anchor" href="#导航-logo-和标题" aria-label="Permalink to &quot;导航 LOGO 和标题&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 左侧导航栏图标也可直接&#39;/logo/vitepress-logo-mini.svg&#39;</span></span>
<span class="line"><span style="color:#E06C75;">		logo</span><span style="color:#ABB2BF;">: { </span><span style="color:#E06C75;">src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/logo/vitepress-logo-mini.svg&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">width</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">24</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">height</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">24</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#E06C75;">		siteTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;VitePress基础框架&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 左侧导航栏标题</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br></div></div><h2 id="导航栏" tabindex="-1">导航栏 <a class="header-anchor" href="#导航栏" aria-label="Permalink to &quot;导航栏&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">		// 导航菜单</span></span>
<span class="line"><span style="color:#E06C75;">		nav</span><span style="color:#ABB2BF;">: </span><span style="color:#61AFEF;">nav</span><span style="color:#ABB2BF;">(),</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 导航菜单</span></span>
<span class="line"><span style="color:#C678DD;">function</span><span style="color:#61AFEF;"> nav</span><span style="color:#ABB2BF;">(): </span><span style="color:#E5C07B;">DefaultTheme</span><span style="color:#ABB2BF;">.</span><span style="color:#E5C07B;">NavItem</span><span style="color:#ABB2BF;">[] {</span></span>
<span class="line"><span style="color:#C678DD;">	return</span><span style="color:#ABB2BF;"> [</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;教程&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 导航栏标题</span></span>
<span class="line"><span style="color:#E06C75;">			link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/guide/install&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 导航栏路径</span></span>
<span class="line"><span style="color:#E06C75;">			activeMatch</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/guide&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 动态匹配路径，高亮显示</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;示例&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/examples/markdown&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			activeMatch</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;/examples&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">		{</span></span>
<span class="line"><span style="color:#E06C75;">			text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;下拉导航&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">				{</span></span>
<span class="line"><span style="color:#E06C75;">					text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;下拉导航标题&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 该部分的标题，也可以省略标题</span></span>
<span class="line"><span style="color:#E06C75;">					items</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;子项A&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://github.com/dcdy/vitepress-template/edit/main/docs/.vitepress/config.mts&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">						{</span></span>
<span class="line"><span style="color:#E06C75;">							text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;子项B&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">							link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://gitee.com/xia_mei_ting/vitepress-template/blob/main/docs/.vitepress/config.mts&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">						},</span></span>
<span class="line"><span style="color:#ABB2BF;">					],</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#ABB2BF;">			],</span></span>
<span class="line"><span style="color:#ABB2BF;">		},</span></span>
<span class="line"><span style="color:#ABB2BF;">	];</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br></div></div><h2 id="深浅主题切换" tabindex="-1">深浅主题切换 <a class="header-anchor" href="#深浅主题切换" aria-label="Permalink to &quot;深浅主题切换&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">		appearance</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">true</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 外观切换 - 深色浅色</span></span>
<span class="line"><span style="color:#E06C75;">		darkModeSwitchLabel</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;主题&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义悬停时显示的深色模式开关标题。</span></span>
<span class="line"><span style="color:#E06C75;">		lightModeSwitchTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;切换到浅色模式&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义悬停时显示的浅色模式开关标题。</span></span>
<span class="line"><span style="color:#E06C75;">		darkModeSwitchTitle</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;切换到深色模式&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#7F848E;font-style:italic;">// 用于自定义深色模式开关标签，该标签仅在移动端视图中显示。</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h2 id="友情连接" tabindex="-1">友情连接 <a class="header-anchor" href="#友情连接" aria-label="Permalink to &quot;友情连接&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">		socialLinks</span><span style="color:#ABB2BF;">: [</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// github友情连接</span></span>
<span class="line"><span style="color:#ABB2BF;">			{ </span><span style="color:#E06C75;">icon</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;github&#39;</span><span style="color:#ABB2BF;">, </span><span style="color:#E06C75;">link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://github.com/dcdy/vitepress-template&#39;</span><span style="color:#ABB2BF;"> },</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// gitee友情连接(自定义图标)</span></span>
<span class="line"><span style="color:#ABB2BF;">			{</span></span>
<span class="line"><span style="color:#E06C75;">				icon</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">					svg</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;&lt;svg t=&quot;1727428813465&quot; class=&quot;icon&quot; viewBox=&quot;0 0 1024 1024&quot; version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; p-id=&quot;2268&quot; width=&quot;200&quot; height=&quot;200&quot;&gt;&lt;path d=&quot;M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z&quot; fill=&quot;#C71D23&quot; p-id=&quot;2269&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">				},</span></span>
<span class="line"><span style="color:#E06C75;">				link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;https://gitee.com/xia_mei_ting/vitepress-template&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">			},</span></span>
<span class="line"><span style="color:#ABB2BF;">		],</span></span>
<span class="line"><span style="color:#ABB2BF;">	},</span></span>
<span class="line"><span style="color:#ABB2BF;">});</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br></div></div><h2 id="主题美化" tabindex="-1">主题美化 <a class="header-anchor" href="#主题美化" aria-label="Permalink to &quot;主题美化&quot;">​</a></h2><h3 id="主题内容" tabindex="-1">主题内容 <a class="header-anchor" href="#主题内容" aria-label="Permalink to &quot;主题内容&quot;">​</a></h3><div class="warning custom-block github-alert"><p class="custom-block-title">警告</p><p></p><p>LOGO 文件放在<code>docs/public/logo</code>下，也可以直接放在 public 文件夹下，src 路径需改为/vitepress-logo-large.webp，其他图片文件同理</p></div><div class="code-label"><div class="code-label-text">index.md</div></div><div class="language-markdown line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"><span style="color:#E06C75;">hero</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">    name</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress 基础框架</span><span style="color:#7F848E;font-style:italic;"> # 标题</span></span>
<span class="line"><span style="color:#E06C75;">    text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress 基础框架的站点描述</span><span style="color:#7F848E;font-style:italic;"> # 站点描述副标题</span></span>
<span class="line"><span style="color:#E06C75;">    tagline</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress 基础框架的宣传词</span><span style="color:#7F848E;font-style:italic;"> # 宣传词</span></span>
<span class="line"><span style="color:#E06C75;">    image</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># LOGO</span></span>
<span class="line"><span style="color:#E06C75;">        src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/logo/vitepress-logo-large.webp</span></span>
<span class="line"><span style="color:#E06C75;">        alt</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">VitePress 基础框架 LOGO</span></span>
<span class="line"><span style="color:#ABB2BF;">---</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h3 id="美化文字和-logo-背景" tabindex="-1">美化文字和 LOGO 背景 <a class="header-anchor" href="#美化文字和-logo-背景" aria-label="Permalink to &quot;美化文字和 LOGO 背景&quot;">​</a></h3><p>新建文件<code>docs/.vitepress/theme/index.ts</code>和<code>docs/.vitepress/theme/custom.css</code></p><div class="code-label"><div class="code-label-text">index.ts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> DefaultTheme</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;vitepress/theme&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">import</span><span style="color:#98C379;"> &#39;./custom.css&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#E06C75;"> DefaultTheme</span><span style="color:#ABB2BF;">;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br></div></div><div class="code-label"><div class="code-label-text">custom.css</div></div><div class="language-css line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">css</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#7F848E;font-style:italic;">/**</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">-   Component: Home 首页</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">-   -------------------------------------------------------------------------- */</span></span>
<span class="line"><span style="color:#56B6C2;">:root</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	/* 首页文字（VitePress基础框架）颜色 */</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-home-hero-name-color</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">transparent</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-home-hero-name-background</span><span style="color:#ABB2BF;">: </span><span style="color:#56B6C2;">-webkit-linear-gradient</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">120</span><span style="color:#E06C75;">deg</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#bd34fe</span><span style="color:#D19A66;"> 30</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#41d1ff</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	/* 首页大logo的背景色 */</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-home-hero-image-background-image</span><span style="color:#ABB2BF;">: </span><span style="color:#56B6C2;">linear-gradient</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">-45</span><span style="color:#E06C75;">deg</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#bd34fe</span><span style="color:#D19A66;"> 50</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#47caff</span><span style="color:#D19A66;"> 50</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-home-hero-image-filter</span><span style="color:#ABB2BF;">: </span><span style="color:#56B6C2;">blur</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">44</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#C678DD;">@media</span><span style="color:#ABB2BF;"> (min-width: </span><span style="color:#D19A66;">640</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#56B6C2;">	:root</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">		--vp-home-hero-image-filter</span><span style="color:#ABB2BF;">: </span><span style="color:#56B6C2;">blur</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">56</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	}</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD;">@media</span><span style="color:#ABB2BF;"> (min-width: </span><span style="color:#D19A66;">960</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">) {</span></span>
<span class="line"><span style="color:#56B6C2;">	:root</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">		--vp-home-hero-image-filter</span><span style="color:#ABB2BF;">: </span><span style="color:#56B6C2;">blur</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">68</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	}</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br></div></div><div class="caution custom-block github-alert"><p class="custom-block-title">注意</p><p></p><p>下面代码示例为：改变整体主题颜色为#a05aff 紫色</p><div class="code-label"><div class="code-label-text">custom.css</div></div><div class="language-css line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">css</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#56B6C2;">:root</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	/* 主题色 */</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-c-indigo-1</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">#a05aff</span><span style="color:#ABB2BF;">; /~ 主题色 ~/</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-c-indigo-2</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">#bd34fe</span><span style="color:#ABB2BF;">; /~ 主题色-hover ~/</span></span>
<span class="line"><span style="color:#E06C75;">	--vp-c-indigo-3</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">#a05aff</span><span style="color:#ABB2BF;">; /~ 实底色的颜色，例如按钮的 bg 颜色 ~/</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div></div><h2 id="actions-按钮" tabindex="-1">actions 按钮 <a class="header-anchor" href="#actions-按钮" aria-label="Permalink to &quot;actions 按钮&quot;">​</a></h2><h3 id="普通-action" tabindex="-1">普通 action <a class="header-anchor" href="#普通-action" aria-label="Permalink to &quot;普通 action&quot;">​</a></h3><div class="code-label"><div class="code-label-text">index.md</div></div><div class="language-markdown line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"><span style="color:#E06C75;">hero</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">    actions</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># 按钮</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">brand</span><span style="color:#7F848E;font-style:italic;"> # 选中状态</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">快速开始</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/guide/install</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">alt</span><span style="color:#7F848E;font-style:italic;"> # 未选中状态</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">示例</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/examples/markdown</span></span>
<span class="line"><span style="color:#ABB2BF;">---</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br></div></div><h3 id="自定义-action" tabindex="-1">自定义 action <a class="header-anchor" href="#自定义-action" aria-label="Permalink to &quot;自定义 action&quot;">​</a></h3><div class="info custom-block github-alert"><p class="custom-block-title">信息</p><p>自定义 action 中 theme 的值会是该 action 的 class 值，所以可以直接在 <code>custom.css</code> 中修改该 action 的样式</p></div><div class="code-label"><div class="code-label-text">index.md</div></div><div class="language-markdown line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"><span style="color:#E06C75;">hero</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">    actions</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># 按钮</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">theme</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">custom-action</span></span>
<span class="line"><span style="color:#E06C75;">          text</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">自定义 action</span></span>
<span class="line"><span style="color:#E06C75;">          link</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/guide/config-home#自定义-action</span></span>
<span class="line"><span style="color:#ABB2BF;">---</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><div class="code-label"><div class="code-label-text">custom.css</div></div><div class="language-css line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">css</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#7F848E;font-style:italic;">/**</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">   * Component: 自定义actions按钮</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">   * -------------------------------------------------------------------------- */</span></span>
<span class="line"><span style="color:#D19A66;">.action</span><span style="color:#D19A66;"> .VPButton.custom-action</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	position: </span><span style="color:#D19A66;">relative</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-color: </span><span style="color:#D19A66;">#ffd859</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	padding-left: </span><span style="color:#D19A66;">45</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	color: </span><span style="color:#D19A66;">#000</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#D19A66;">.action</span><span style="color:#D19A66;"> .VPButton.custom-action</span><span style="color:#56B6C2;">::before</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	content: </span><span style="color:#98C379;">&#39;&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	position: </span><span style="color:#D19A66;">absolute</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	left: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	top: </span><span style="color:#D19A66;">50</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	transform: </span><span style="color:#56B6C2;">translateY</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">-50</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	width: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	height: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-image: </span><span style="color:#56B6C2;">url</span><span style="color:#ABB2BF;">(</span><span style="color:#98C379;">&#39;/logo/vitepress-logo-mini.png&#39;</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-size: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#D19A66;"> 20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-repeat: </span><span style="color:#D19A66;">no-repeat</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-position: </span><span style="color:#D19A66;">center</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#D19A66;">.VPFeature</span><span style="color:#E06C75;"> img</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	width: </span><span style="color:#D19A66;">30</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	height: </span><span style="color:#D19A66;">30</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	padding: </span><span style="color:#D19A66;">9</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	border-radius: </span><span style="color:#D19A66;">6</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	box-sizing: </span><span style="color:#D19A66;">content-box</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-color: </span><span style="color:#56B6C2;">var</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">--vp-c-default-soft</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br></div></div><h3 id="自定义插槽-action" tabindex="-1">自定义插槽 action <a class="header-anchor" href="#自定义插槽-action" aria-label="Permalink to &quot;自定义插槽 action&quot;">​</a></h3><ol><li>新建文件<code>docs/.vitepress/theme/components/CustomHomeSlot.vue</code>文件</li></ol><details class="details custom-block"><summary>点击查看 <code>CustomHomeSlot.vue</code> 文件的代码</summary><div class="code-label"><div class="code-label-text">CustomHomeSlot.vue</div></div><div class="language-vue line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">vue</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#7F848E;font-style:italic;">&lt;!-- 自定义布局插槽 --&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;</span><span style="color:#E06C75;">template</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">	&lt;</span><span style="color:#E06C75;">Layout</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">		&lt;</span><span style="color:#E06C75;">template</span><span style="color:#ABB2BF;"> #</span><span style="color:#D19A66;">home-hero-actions-after</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">			&lt;</span><span style="color:#E06C75;">div</span><span style="color:#D19A66;"> class</span><span style="color:#ABB2BF;">=</span><span style="color:#98C379;">&quot;custom-action-plain&quot;</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">				&lt;</span><span style="color:#E06C75;">img</span><span style="color:#D19A66;"> src</span><span style="color:#ABB2BF;">=</span><span style="color:#98C379;">&quot;/logo/vitepress-logo-mini.png&quot;</span><span style="color:#D19A66;"> alt</span><span style="color:#ABB2BF;">=</span><span style="color:#98C379;">&quot;action-logo&quot;</span><span style="color:#ABB2BF;"> /&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">				&lt;</span><span style="color:#E06C75;">a</span><span style="color:#D19A66;"> href</span><span style="color:#ABB2BF;">=</span><span style="color:#98C379;">&quot;./guide/config-home#自定义插槽-action&quot;</span><span style="color:#ABB2BF;">&gt;自定义插槽action&lt;/</span><span style="color:#E06C75;">a</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">			&lt;/</span><span style="color:#E06C75;">div</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">		&lt;/</span><span style="color:#E06C75;">template</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">	&lt;/</span><span style="color:#E06C75;">Layout</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;/</span><span style="color:#E06C75;">template</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;</span><span style="color:#E06C75;">script</span><span style="color:#D19A66;"> setup</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 导入主题布局组件</span></span>
<span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> DefaultTheme</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;vitepress/theme&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">const</span><span style="color:#ABB2BF;"> { </span><span style="color:#E5C07B;">Layout</span><span style="color:#ABB2BF;"> } </span><span style="color:#56B6C2;">=</span><span style="color:#E06C75;"> DefaultTheme</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;/</span><span style="color:#E06C75;">script</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;</span><span style="color:#E06C75;">style</span><span style="color:#D19A66;"> lang</span><span style="color:#ABB2BF;">=</span><span style="color:#98C379;">&quot;scss&quot;</span><span style="color:#ABB2BF;">&gt;</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">// 设置自定义插槽action样式</span></span>
<span class="line"><span style="color:#D19A66;">.custom-action-plain</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	position: </span><span style="color:#D19A66;">relative</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	display: </span><span style="color:#D19A66;">inline-flex</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	justify-content: </span><span style="color:#D19A66;">center</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	align-items: </span><span style="color:#D19A66;">center</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	height: </span><span style="color:#D19A66;">40</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	margin-top: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	padding: </span><span style="color:#D19A66;">4</span><span style="color:#E06C75;">px</span><span style="color:#D19A66;"> 24</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	border-radius: </span><span style="color:#D19A66;">100</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	font-size: </span><span style="color:#D19A66;">14</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	font-weight: </span><span style="color:#D19A66;">600</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	white-space: </span><span style="color:#D19A66;">nowrap</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-color: </span><span style="color:#56B6C2;">var</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">--vp-c-bg-elv</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#E06C75;">	cursor</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">pointer</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#E06C75;">	img</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">		width: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">		height: </span><span style="color:#D19A66;">20</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">		margin-right: </span><span style="color:#D19A66;">6</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	}</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#D19A66;">.custom-action-plain</span><span style="color:#56B6C2;">:hover::before</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-image: </span><span style="color:#56B6C2;">linear-gradient</span><span style="color:#ABB2BF;">(</span><span style="color:#56B6C2;">var</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">--rotate</span><span style="color:#ABB2BF;">), </span><span style="color:#D19A66;">#ffd859</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#ff5555</span><span style="color:#D19A66;"> 43</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#a805be</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#D19A66;">.custom-action-plain</span><span style="color:#56B6C2;">::before</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">	content</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	position: </span><span style="color:#D19A66;">absolute</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	top: </span><span style="color:#D19A66;">-3</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	left: </span><span style="color:#D19A66;">-3</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	z-index: </span><span style="color:#D19A66;">-1</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	width: </span><span style="color:#56B6C2;">calc</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">100</span><span style="color:#E06C75;">%</span><span style="color:#56B6C2;"> +</span><span style="color:#D19A66;"> 6</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	height: </span><span style="color:#56B6C2;">calc</span><span style="color:#ABB2BF;">(</span><span style="color:#D19A66;">100</span><span style="color:#E06C75;">%</span><span style="color:#56B6C2;"> +</span><span style="color:#D19A66;"> 6</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">	border-radius: </span><span style="color:#D19A66;">100</span><span style="color:#E06C75;">px</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	animation: spin </span><span style="color:#D19A66;">3</span><span style="color:#E06C75;">s</span><span style="color:#D19A66;"> linear</span><span style="color:#D19A66;"> infinite</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	background-image: </span><span style="color:#56B6C2;">linear-gradient</span><span style="color:#ABB2BF;">(</span><span style="color:#56B6C2;">var</span><span style="color:#ABB2BF;">(</span><span style="color:#E06C75;">--rotate</span><span style="color:#ABB2BF;">), </span><span style="color:#D19A66;">#a805be</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#3c67e3</span><span style="color:#D19A66;"> 43</span><span style="color:#E06C75;">%</span><span style="color:#ABB2BF;">, </span><span style="color:#D19A66;">#4e00c2</span><span style="color:#ABB2BF;">);</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD;">@keyframes</span><span style="color:#61AFEF;"> spin</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#D19A66;">	0%</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">		--rotate</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">0</span><span style="color:#E06C75;">deg</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	}</span></span>
<span class="line"><span style="color:#D19A66;">	100%</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">		--rotate</span><span style="color:#ABB2BF;">: </span><span style="color:#D19A66;">360</span><span style="color:#E06C75;">deg</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	}</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#ABB2BF;">@property </span><span style="color:#E06C75;">--rotate</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#ABB2BF;">	syntax: </span><span style="color:#98C379;">&#39;&lt;angle&gt;&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	initial-value: </span><span style="color:#D19A66;">132</span><span style="color:#E06C75;">deg</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#ABB2BF;">	inherits: false;</span></span>
<span class="line"><span style="color:#ABB2BF;">}</span></span>
<span class="line"><span style="color:#ABB2BF;">&lt;/</span><span style="color:#E06C75;">style</span><span style="color:#ABB2BF;">&gt;</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br></div></div></details><ol start="2"><li>theme 文件夹下的 index.ts 中引入<code>CustomHomeSlot.vue</code>文件</li></ol><div class="code-label"><div class="code-label-text">index.ts</div></div><div class="language-ts line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">ts</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> DefaultTheme</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;vitepress/theme&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">import</span><span style="color:#98C379;"> &#39;./custom.css&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"><span style="color:#C678DD;">import</span><span style="color:#E06C75;"> MyLayout</span><span style="color:#C678DD;"> from</span><span style="color:#98C379;"> &#39;./components/CustomHomeSlot.vue&#39;</span><span style="color:#ABB2BF;">;</span></span>
<span class="line"></span>
<span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#ABB2BF;"> {</span></span>
<span class="line"><span style="color:#E06C75;">	extends</span><span style="color:#ABB2BF;">: </span><span style="color:#E06C75;">DefaultTheme</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">	// 使用注入插槽的包装组件覆盖 Layout</span></span>
<span class="line"><span style="color:#E06C75;">	Layout</span><span style="color:#ABB2BF;">: </span><span style="color:#E06C75;">MyLayout</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">};</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br></div></div><h2 id="features-部分" tabindex="-1">Features 部分 <a class="header-anchor" href="#features-部分" aria-label="Permalink to &quot;Features 部分&quot;">​</a></h2><div class="info custom-block github-alert"><p class="custom-block-title">信息</p><p>普通 feature 部分使用<code>title</code> 作为标题， <code>icon</code> 作为图标，<code>details</code> 作为描述； icon 有三种写法</p><ol><li>直接放一个 emoji 图标或 svg 代码。例：下面标题为“内容丰富”的 icon 代码</li><li>直接放一个 svg 图标（width 和 height 可以不加）。例：下面标题为“注释详尽”的 icon 代码</li><li>区分 dark 和 light 两种图标（width 和 height 可以不加）。例：下面标题为“高效构建”的 icon 代码</li></ol></div><div class="code-label"><div class="code-label-text">index.md</div></div><div class="language-markdown line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">markdown</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#ABB2BF;">---</span></span>
<span class="line"><span style="color:#E06C75;">hero</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">    features</span><span style="color:#ABB2BF;">: </span><span style="color:#7F848E;font-style:italic;"># 特性</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">内容丰富</span></span>
<span class="line"><span style="color:#E06C75;">          icon</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">📚</span></span>
<span class="line"><span style="color:#E06C75;">          details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">模板精心设计了内容结构，支持从小型项目到大型文档的全面组织，确保每个细节都能够清晰呈现，帮助用户快速查找所需信息。</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">注释详尽</span></span>
<span class="line"><span style="color:#E06C75;">          icon</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">              src</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-1.svg</span></span>
<span class="line"><span style="color:#E06C75;">              width</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">              height</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">          details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">每一处配置、每一个功能都有详细的注释说明，确保即使是新手也能轻松理解和使用，让文档维护和二次开发变得更加简单。</span></span>
<span class="line"><span style="color:#ABB2BF;">        - </span><span style="color:#E06C75;">title</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">高效构建</span></span>
<span class="line"><span style="color:#E06C75;">          icon</span><span style="color:#ABB2BF;">:</span></span>
<span class="line"><span style="color:#E06C75;">              dark</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-2.svg</span></span>
<span class="line"><span style="color:#E06C75;">              light</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">/features_icon/features-icon-3.svg</span></span>
<span class="line"><span style="color:#E06C75;">              width</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">              height</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">30px</span></span>
<span class="line"><span style="color:#E06C75;">          details</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">基于 Vite 的超快构建和热更新特性，让文档编写和预览流畅无阻。无论文档规模多大，都能保持快速响应和高效加载。</span></span>
<span class="line"><span style="color:#ABB2BF;">---</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br></div></div><h2 id="底部版权信息" tabindex="-1">底部版权信息 <a class="header-anchor" href="#底部版权信息" aria-label="Permalink to &quot;底部版权信息&quot;">​</a></h2><div class="code-label"><div class="code-label-text">config.mts</div></div><div class="language-js line-numbers-mode"><button title="复制代码" class="copy"></button><span class="lang">js</span><pre class="shiki one-dark-pro vp-code" tabindex="0"><code><span class="line"><span style="color:#C678DD;">export</span><span style="color:#C678DD;"> default</span><span style="color:#61AFEF;"> defineConfig</span><span style="color:#ABB2BF;">({</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">    // 主题配置</span></span>
<span class="line"><span style="color:#E06C75;">	themeConfig</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#E06C75;">        footer</span><span style="color:#ABB2BF;">: {</span></span>
<span class="line"><span style="color:#7F848E;font-style:italic;">			// 有 sidebar 时不显示</span></span>
<span class="line"><span style="color:#E06C75;">			message</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">&#39;基于MIT许可发布&#39;</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#E06C75;">			copyright</span><span style="color:#ABB2BF;">: </span><span style="color:#98C379;">`版权所有 © </span><span style="color:#C678DD;">${</span></span>
<span class="line"><span style="color:#C678DD;">				new</span><span style="color:#61AFEF;"> Date</span><span style="color:#ABB2BF;">().</span><span style="color:#61AFEF;">getFullYear</span><span style="color:#ABB2BF;">() </span><span style="color:#56B6C2;">==</span><span style="color:#D19A66;"> 2024</span><span style="color:#C678DD;"> ?</span><span style="color:#D19A66;"> 2024</span><span style="color:#C678DD;"> :</span><span style="color:#D19A66;"> 2024</span><span style="color:#56B6C2;"> +</span><span style="color:#98C379;"> &#39;-&#39;</span><span style="color:#56B6C2;"> +</span><span style="color:#C678DD;"> new</span><span style="color:#61AFEF;"> Date</span><span style="color:#ABB2BF;">().</span><span style="color:#61AFEF;">getFullYear</span><span style="color:#ABB2BF;">()</span></span>
<span class="line"><span style="color:#C678DD;">			}</span><span style="color:#98C379;"> dcdyxmt@163.com`</span><span style="color:#ABB2BF;">,</span></span>
<span class="line"><span style="color:#ABB2BF;">		}</span></span>
<span class="line"><span style="color:#ABB2BF;">    }</span></span>
<span class="line"><span style="color:#ABB2BF;">}）</span></span></code></pre><div class="line-numbers-wrapper" aria-hidden="true"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br></div></div></div></div></main><footer class="VPDocFooter" data-v-184b3be7 data-v-418b990b><!--[--><!--]--><div class="edit-info" data-v-418b990b><div class="edit-link" data-v-418b990b><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/dcdy/vitepress-template/edit/main/docs/guide/config-home.md" target="_blank" rel="noreferrer" data-v-418b990b><!--[--><span class="vpi-square-pen edit-link-icon" data-v-418b990b></span> 在 GitHub 上编辑此页面<!--]--></a></div><div class="last-updated" data-v-418b990b><p class="VPLastUpdated" data-v-418b990b data-v-6a80e2fe>最后更新于: <time datetime="2024-12-03T05:11:06.000Z" data-v-6a80e2fe></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-418b990b><span class="visually-hidden" id="doc-footer-aria-label" data-v-418b990b>Pager</span><div class="pager" data-v-418b990b><a class="VPLink link pager-link prev" href="/vitepress-template-public/guide/install" data-v-418b990b><!--[--><span class="desc" data-v-418b990b>上一页</span><span class="title" data-v-418b990b>安装</span><!--]--></a></div><div class="pager" data-v-418b990b><a class="VPLink link pager-link next" href="/vitepress-template-public/guide/config-doc" data-v-418b990b><!--[--><span class="desc" data-v-418b990b>下一页</span><span class="title" data-v-418b990b>文档配置</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><footer class="VPFooter has-sidebar" data-v-b928bd87 data-v-fdadc4f9><div class="container" data-v-fdadc4f9><p class="message" data-v-fdadc4f9>基于MIT许可发布</p><p class="copyright" data-v-fdadc4f9>版权所有 © 2024 dcdyxmt@163.com</p></div></footer><!--[--><!--]--></div></div>
    
    
  </body>
</html>